<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>用户中心</title>
        <base href="${pageContext.request.contextPath}/">
        <script type="text/javascript" src="js/wangEditor.min.js"></script>
        <script type="text/javascript" src="https://unpkg.com/wangeditor@3.1.1/release/wangEditor.min.js"></script>
        <link rel="stylesheet" href="css/bootstrap.min.css"/>
        <link rel="stylesheet" href="css/style.css"/>
        <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" crossorigin="anonymous">
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" crossorigin="anonymous"></script>
        <link rel="stylesheet" href="css/style.css"/>

    </head>
    <body style="background-color: #f7f7f7; ">

        <div class="header-most-top">
            <div class="container">
                <div class="row">
                    <div class="col-lg-7 col-md-8 col-sm-8 col-12">
                        <div class="main-flex-top">
                            <div class="email sel d-flex">
                                <div style="margin-right: 10px;" class="main-email-text d-flex">
                                    <i class="glyphicon glyphicon-home"></i>
                                    <a style="font-size: 14px; color: #e9dbf0;font-weight: 500;" class="nav-link active" href="index">首页</a>
                                </div>
                                <div class="main-loc-text d-flex">
                                    <i class="glyphicon glyphicon-tags"></i>
                                    <a style="font-size: 14px; color: #e9dbf0;font-weight: 500;" class="nav-link active" href="index">读书日志</a>
                                    <a style="font-size: 14px; color: #e9dbf0;font-weight: 500;" class="nav-link active" href="index">读书活动</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-5 col-md-4 col-sm-4 col-12">
                        <div class="login-area">
                            <div class="seclict-area">
                                <i class="glyphicon glyphicon-home" style="color: #e9dbf0;"></i>
                                <select name="cars">
                                    <option value="volvo">CN</option>
                                    <option value="saab">US</option>
                                    <option value="fiat">GE</option>
                                    <option value="audi">FRANCH</option>
                                </select>
                            </div>
                            <div class="user-log">
                                <i class="glyphicon glyphicon-user"></i>
                                <a href="toUserActivity">${loginUser.uname}&nbsp;|</a>  
                                <img src="${loginUser.uhead}">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="user-background">
            <img style="height: 400px; width: 100%" src="img/325001.jpg" alt="">
        </div>               

        <!--导航栏-->
        <header id="top-heder-nav">
            <nav class="navbar navbar-expand-lg" data-toggle="sticky-onscroll">
                <div class="collapse navbar-collapse" id="navbarResponsive">
                    <ul style="margin-left: 400px;" class="navbar-nav">
                        <li class="nav-item"><a class="nav-link active" href="index">我的窝</a></li>
                        <li style="margin-left: 150px;" class="nav-item"><a class="nav-link active" href="logdetail/ulog?uname=${loginUser.uname}">我的日志</a></li>
                        <li style="margin-left: 150px;" class="nav-item"><a class="nav-link active" href="publish/plog?uname=${loginUser.uname}">发布日志</a></li>
                    </ul>
                </div>
            </nav>
        </header>

        <div style="width: 1300px;" class="container content-box">
            <div class="user-area">
                <img src="${loginUser.uhead}">
                <br>
                <br>
                <font style="font-family: 幼圆;font-size: 16px;"><b>${loginUser.uname}</b>&nbsp;&nbsp;<span style="color: #ff9d33;">${loginUser.ugender}</span></font>
                <p style="font-size: 14px;">等级：<b><span style="color: #ff9d33;">lv.${loginUser.urank}</span></b></p>
                <p style="color: #000; font-size: 12px;">来自慢时光游记</p>
            </div> 

            <!--右侧div-->
            <div class="user-right" style="margin-left:60px;float:left;">
                <div class="activity-area1" style="height: 900px;width:1000px;">
                    <div align="center" >
                        <br><br>
                        <!--<form action="ueditor">-->
                        <form action="publish/save" method="post">
                            <span style="font-size: 16px;color: #a897c9;margin-left:-520px;">书籍名称：</span><br>
                            <input style="width:600px;" type="text"  id="ltitle" class="form-control aa">
                            <br><br>
                            <span style="font-size: 16px;color: #a897c9;margin-left:-520px;">书籍简介：</span><br>
                            <input  style="width:600px;" type="text" id="lcontent" class="form-control aa">
                            <br><br>
                            <span style="font-size: 16px;color: #a897c9;margin-left:-520px;">书籍分类：</span><br>
                            <input  style="width:600px;" type="text"  id="llable" class="form-control aa">
                            <br><br>
                            <span style="font-size: 16px;color: #a897c9;margin-left:-510px;">书籍缩略图：</span><br>
                            <input style="width:600px;" type="file"  id="limg" >
                            <br><br>

                            <input type="hidden" value="${loginUser.uname}" id="puname"/>
                            <span style="font-size: 16px;color: #a897c9;margin-left:-520px;">读书笔记：</span>

                            <!--富文本编辑器-->

                            <div id="contentDiv"style=" display:block;margin-top:10px;"></div>
                            <textarea name="content" id="content" style="display:none" ></textarea>
                            <br>
                            <div class="row" style="margin-left:200px;">
                                <!--                                                <div class="col-md-6 col-md-offset-4">
                                                                                    <button id="submit" class="btn btn-default" style="margin-left:-350px;">发布日志</button>
                                                                                </div>-->
                            </div>
                            <br>
                            <!--</form>-->
                            <script>
                                var E = window.wangEditor;
                                var editor = new E("#contentDiv")
                                editor.customConfig.uploadImgShowBase64 = true
                                editor.create();
                                //点击提交命令，将数据提交到后台
                                $(document).ready(function () {

                                    $("#submitBtn").click(function () {
                                        var content = editor.txt.html();
                                        //获取富文本数据
                                        $.ajax({
                                            url: 'publish/save',
                                            type: "POST",
                                            data: {llabel:$("#llable").val(),
                                                ltitle:$("#ltitle").val(),
                                                lcontent:$("#lcontent").val(),
                                                content: content,
                                                puname:$("#puname").val()
            },
                                            success: function (content) {
//                                                        alert(content);
                                            },
                                            error: function (req, status, error) {
                                                alert("Ajax请求失败！" + error);
                                            }
                                        });
                                    });
                                });


                            </script>

                            <!--富文本编辑器 end-->
                            <input id="submitBtn"  type="button" value="提交" class="btn btn-default">
                        </form>

                    </div>
                </div>
            </div>
        </div>
        <!--尾部-->
        <div class="footre-bottom">
            <div class="container">
                <div class="row">
                    <div class="col-lg-6 col-md-8 col-sm-8 col-8">
                        <div class="copy-right-para">
                            <p>版权所有 &copy; 2019.张彦 陈新 毕爱卿 付丽瑶</p>
                        </div>
                    </div>
                    <div class="col-lg-6 col-md-4 col-sm-4 col-4">
                        <div class="copy-right-icon">
                            <a href="#"><i class="glyphicon glyphicon-thumbs-up face no-ag"></i></a>
                            <a href="#"><i class="glyphicon glyphicon-gift face"></i></a>
                            <a href="#"><i class="glyphicon glyphicon-heart-empty face"></i></a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>



</html>
